<div
    bsModal
    #actionModal="bs-modal"
    class="modal fade"
    tabindex="-1"
    role="dialog"
    aria-labelledby="actionModal"
    aria-hidden="true"
    [config]="{ backdrop: 'static' }"
>
    <div class="modal-dialog modal-xxl">
        <div class="modal-content">
            <form
                *ngIf="active"
                #editForm="ngForm"
                novalidate
                (ngSubmit)="save()"
            >
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>批量打印信息</span>
                    </h4>
                    <button
                        type="button"
                        class="close"
                        (click)="close()"
                        aria-label="Close"
                    >
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="form-group col-lg-12">
                            <!-- <div class="col-md-4" style="float: left;">
                                <label>选择交接车间: </label>
                                <select
                                    name="departments"
                                    class="form-control"
                                    [(ngModel)]="departmentValue"
                                    title="选择交接车间"
                                >
                                    <option [value]="0">选择交接车间</option>
                                    <option
                                        *ngFor="let item of departments"
                                        [value]="item.value"
                                        >{{ item.name }}</option
                                    >
                                </select>
                            </div>
                            <div class="col-md-4" style="float: left;">
                                <label>备注: </label>
                                <input
                                    style="width: 98%; height: 40px;"
                                    class="form-control"
                                    name="remark"
                                    type="text"
                                    [(ngModel)]="remark"
                                />
                            </div> -->
                            <div class="col-md-4" style="float: left;">
                                <label>选择打印机: </label><br />
                                <p-dropdown
                                    [options]="teamGroups"
                                    name="teamGroups"
                                    [(ngModel)]="teamGroupName"
                                    placeholder="选择打印机"
                                    optionLabel="displayText"
                                    [style]="{ width: '100%' }"
                                ></p-dropdown>
                            </div>
                        </div>
                    </div>
                    <div
                        class="primeng-datatable-container"
                        [busyIf]="primengTableHelper.isLoading"
                    >
                        <p-table
                            #dataTable
                            [value]="printPipe"
                            rows="10"
                            [paginator]="true"
                            [lazy]="true"
                            emptyMessage="没有数据"
                            scrollable="true"
                            ScrollWidth="100%"
                            [loading]="loading"
                        >
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 150px;">
                                        任务号
                                    </th>
                                    <th style="width: 150px;">
                                        图号
                                    </th>
                                    <th style="width: 100px;">
                                        产品名称
                                    </th>

                                    <th style="width: 100px;">
                                        合格证
                                    </th>
                                    <th style="width: 100px;">
                                        交接车间
                                    </th>
                                    <th style="width: 100px;">
                                        数量
                                    </th>
                                    <th style="width: 100px;">
                                        操作
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template
                                pTemplate="body"
                                let-record="$implicit"
                                let-ri="rowIndex"
                            >
                                <tr>
                                    <!-- <td style="width: 150px;">
                            {{ record.size }}
                        </td> -->
                                    <td style="width: 150px;">
                                        {{ record.taskCode }}
                                    </td>
                                    <td style="width: 150px;">
                                        {{ record.drawingCode }}
                                    </td>
                                    <td style="width: 100px;">
                                        {{ record.drawingName }}
                                    </td>
                                    <td style="width: 100px;">
                                        {{ record.hgz }}
                                    </td>
                                    <td style="width: 100px;">
                                        {{ record.destinationName }}
                                    </td>
                                    <td style="width: 100px;">
                                        {{ record.quantity }}
                                    </td>
                                    <td style="width: 100px;">
                                        <button
                                            pButton
                                            type="button"
                                            pInitEditbaleRow
                                            icon="pi pi-times"
                                            class="ui-button-danger"
                                            (click)="onRowEditInit(ri)"
                                        ></button>
                                    </td>
                                </tr>
                            </ng-template>
                        </p-table>
                    </div>
                </div>

                <div class="modal-footer">
                    <button
                        [disabled]="saving"
                        type="button"
                        class="btn btn-default"
                        (click)="close()"
                    >
                        {{ l('Cancel') }}
                    </button>
                    <button
                        [disabled]="printPipe == ''"
                        type="submit"
                        class="btn btn-primary blue"
                        [buttonBusy]="saving"
                        [busyText]="'打印中...'"
                    >
                        <i class="fa fa-check-circle"></i>
                        <span>打印</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
